Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
MVP implementation of the challenge
The current implementation is done with the provided techStack and also added the next libraries:
Approach:
As per requested MVP is used as pattern for the client solution. For network layer a data provider was created using RX to execute network requests, and in order to solve the lifecycle integration of the singleton data provider, live data is being used to subscribe to the network results in the ui.
The presenter is initialized along with the view, this way if the view is destroyed, the presenter is destroyed as well, so no memory leak issues when the Presenter interface is implemented by the UI.
Unit Test
unit test was provided for the presenter logic, using only JDK not Android environment, this are the faster test that do not require an emulator running.
Android test
Android tests were not requested but it is possible to inject mocks of the DataProvider and verify the ui is presented properly on the screen with Espresso.
Videos